package itheima.d02;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class Test1 {
    public static void main(String[] args) {

        Map<String,Integer> map =new HashMap<>();
        map.put("张三",18);
        map.put("王五",19);
        map.put("赵六",20);
        map.put("胡一天",21);
        map.put("李云龙",18);



        Set<Map.Entry<String, Integer>> entries = map.entrySet();


        entries.forEach(System.out::println);


        for (Map.Entry<String, Integer> entry : entries) {
            String key = entry.getKey();
            Integer value = entry.getValue();
            System.out.println(key+"---"+value);
        }


    }

}
